﻿using HelloOne.Repositories;
using System;

namespace HelloOne.NewsSvc.Models
{
    /// <summary>
    /// 文章
    /// </summary>
    public class News : IEntity
    {
        public News()
        {
            Sort = 0;
            IsDeleted = false;
            ID = Guid.NewGuid();
            CreatedDate =UpdatedDate= DateTime.Now;
        }
        public News(string title,string author, string content,int sort) : this()
        {
            Title = Title;
            Author = author;
            Content = content;
            Sort = sort;
        }

        public Guid ID { get; set; }
        public string Title { get; set; }
        /// <summary>
        /// 封面图片ID
        /// </summary>
        public Guid? CoverID { get; set; }
        public string Content { get; set; }
        public string Author { get; set; }
        public int Sort { get; set; }
        public DateTime CreatedDate { get; set; }
        public DateTime UpdatedDate { get; set; }
        public bool IsDeleted { get; set; }
        public Guid CategoryID { get;set;}
        public Category Category { get; set; }
    }
}
